import { Request, Response } from 'express';

// mock tableListDataSource
const dataSource: any[] = [];

for (let i = 0; i < 10; i += 1) {
  dataSource.push({
    id: 123456 + i,
    orderId: 123456 + i,
    expCode: `DH123456${i}`,
    problemType: 10101,
    problemDesc: '退回件',
    consigneePhone: '13885093094',
    courierName: '小新',
    transhipUser: '小强',
    inTime: '2020-1-1 12:12:12',
    pkgNum: 10,
    processCount: 20,
    address: '贵州省遵义县三合镇',
    expressName: '圆通快递',
    statusName: '正常',
    status: 10101,
    smsStatus: 1,
    updateTime: '2020-1-1 12:12:12',
    updateUser: '张三',
  });
}

function getProblemList(req: Request, res: Response, u: string) {
  const result = {
    code: 0,
    message: 'success',
    body: {
      count: 56,
      list: dataSource,
    },
  };

  return res.json(result);
}

export default {
  'GET /problem/list': getProblemList,
};
